package com.biannuo.szk.demo.consumer.config;

import com.biannuo.szk.demo.consumer.fallback.DemoConsumerClientFallback;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 消费
 *
 * @author szk
 */
@Configuration
@EnableFeignClients(basePackages = "com.biannuo.szk.demo.consumer.feign")
@Import(FeignClientsConfiguration.class)
public class DemoConsumerFeginConfiguration {
    /**
     * Set the Feign specific log level to log client REST requests.
     */
    @Bean
    feign.Logger.Level feignLoggerLevel() {
        return feign.Logger.Level.BASIC;
    }

    /**
     * demo feign client fallback
     */
    @Bean
    public DemoConsumerClientFallback demoProviderClientFallback() {
        return new DemoConsumerClientFallback();
    }
}
